﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace WenXia
{
    class MouseCom : DrawableGameComponent
    {
        SpriteBatch spriteBatch;
        Texture2D mtex;
        Rectangle mouseRect;
        public void SetPos(int x, int y)
        {
            mouseRect = new Rectangle(x, y, 30, 30);
        }
        public MouseCom(Game game)
            : base(game)
        {
            this.DrawOrder = 2048;

        }
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(Game.GraphicsDevice);
            mtex = Game.Content.Load<Texture2D>("pointer");
        }
        public override void Draw(GameTime gameTime)
        {
            spriteBatch.Begin();
            spriteBatch.Draw(mtex, mouseRect, Color.White);
            spriteBatch.End();
            base.Draw(gameTime);
        }
    }
}
